cmake_minimum_required(VERSION 3.0) # 指定 CMake 的最低版本要求
project(MyOpenCVProject) # 定义项目名称

# 指定 C++ 标准
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread")

# 设置构建类型为 Debug
set(CMAKE_BUILD_TYPE Debug)

# 查找 OpenCV 库
find_package(OpenCV 4 REQUIRED) # 你可以根据需要更改版本号

# 包含 OpenCV 头文件目录
include_directories(${OpenCV_INCLUDE_DIRS})

# 定义要编译的源文件
add_executable(MyExecutable main.cpp grab.cpp) 
# add_executable(MyExecutable testCompare.cpp) # 测试用

# 链接 OpenCV 库
target_link_libraries(MyExecutable ${OpenCV_LIBS} X11 Xext)
